<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/14
 * Time: 17:10
 */

namespace api\flower\model;
use think\Model;

class FlowerChatsModel extends Model
{
    /**
     * @param $img
     * @return mixed|string
     * 将以json格式存储的图片转成数组
     */
    protected function getImgAttr($img){
        if(!empty($img)){//addslashes(json_encode($data['imgs']));
            $img = stripslashes($img);
            $img = json_decode($img);
            return $img;
        }else{
            return $img;
        }
    }
}